//package com.hsb.seckill.config.mqConfig;
//
//import org.springframework.amqp.core.*;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * rabbitmq配置类(topic模式)
// */
//@Configuration
//public class RabbitMQTopicConfig {
//
//    private static final String QUEUE01 = "topic01";
//    private static final String QUEUE02 = "topic02";
//    private static final String EXCHANGE = "topicExchange";
//    private static final String ROUTINGKEY01 = "#.queue.#";
//    private static final String ROUTINGKEY02 = "*.queue.#";
//
//    //创建队列1
//    @Bean
//    public Queue queue01(){
//        return new Queue(QUEUE01);
//    }
//    //创建队列2
//    @Bean
//    public Queue queue02(){
//        return new Queue(QUEUE02);
//    }
//
//    //创建交换机
//    @Bean
//    public TopicExchange topicExchange(){
//        return new TopicExchange(EXCHANGE);
//    }
//
//    //交换机绑定队列1
//    @Bean
//    public Binding binding01(){
//        return BindingBuilder.bind(queue01()).to(topicExchange()).with(ROUTINGKEY01);
//    }
//    //交换机绑定队列2
//    @Bean
//    public Binding binding02(){
//        return BindingBuilder.bind(queue02()).to(topicExchange()).with(ROUTINGKEY02);
//    }
//}
